@model LocalizationPartViewModel

@if (!string.IsNullOrEmpty(Model.LocalizationSet) && Model.ContentItemCultures.Any())
{
    <div class="btn-group">
        <button type="button" class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            @T["Localizations"]
        </button>
        <div class="dropdown-menu dropdown-menu-right">
            @foreach (var culture in Model.ContentItemCultures)
            {
                if (!string.IsNullOrEmpty(culture.ContentItemId))
                {
                    <a class="dropdown-item btn-sm" asp-action="Edit" asp-controller="Admin" asp-route-area="OrchardCore.Contents" asp-route-contentItemId="@culture.ContentItemId" itemprop="UnsafeUrl" title=@T["Edit {0}", culture.Culture.DisplayName]><i class="fa fa-edit"></i> @culture.Culture.DisplayName | @culture.Culture.Name </a>
                }
                else
                {
                    <a class="dropdown-item btn-sm" itemprop="UnsafeUrl" asp-action="Localize" asp-controller="Admin" asp-route-area="OrchardCore.ContentLocalization" asp-route-contentItemId="@Model.LocalizationPart.ContentItem.ContentItemId" asp-route-targetCulture="@culture.Culture.Name" title=@T["Create {0}", culture.Culture.DisplayName]><i class="fa fa-plus"></i> @culture.Culture.DisplayName | @culture.Culture.Name</a>
                }
            }
        </div>
    </div>
}
